﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace TreeBuilder
{
	/// <summary>
	/// Interaction logic for ArrowHead.xaml
	/// </summary>
	public partial class ArrowHead : UserControl, IPrintable
	{


		public Brush Brush
		{
			get { return (Brush)GetValue(BrushProperty); }
			set { SetValue(BrushProperty, value); }
		}

		// Using a DependencyProperty as the backing store for Brush.  This enables animation, styling, binding, etc...
		public static readonly DependencyProperty BrushProperty =
			DependencyProperty.Register("Brush", typeof(Brush), typeof(ArrowHead), new UIPropertyMetadata(Brushes.Black));

	    public Point Top
	    {
	        get
	        {
                var x = (double)GetValue(Canvas.LeftProperty);
                var y = (double)GetValue(Canvas.TopProperty);
	            var size = this.ActualWidth;
                return new Point(x + size/2, y);
	        }
	    }

		public ArrowHead()
		{
			InitializeComponent();
		}

		#region Implementation of IPrintable



		public bool IsBeingPrinted
		{
			get { return (bool)GetValue(IsBeingPrintedProperty); }
			set { SetValue(IsBeingPrintedProperty, value); }
		}

		// Using a DependencyProperty as the backing store for IsBeingPrinted.  This enables animation, styling, binding, etc...
		public static readonly DependencyProperty IsBeingPrintedProperty =
			DependencyProperty.Register("IsBeingPrinted", typeof(bool), typeof(ArrowHead), new UIPropertyMetadata(false));



		#endregion
	}
}
